package com.jusda.api.controller;

import com.jusda.entity.UserScore;
import com.jusda.service.update.UpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author:y022 23/04/2022 14:56
 * @description:
 */
@RestController
@RequestMapping("/update")
public class UpdateApi {
    @Autowired
    private UpdateService updateService;


    @PostMapping("updateUserScore")
    public void updateUserScore(@RequestBody UserScore userScore) {
        updateService.updateUserScore(userScore);
    }

    @PostMapping("test")
    public void test(@RequestBody UserScore userScore) throws IOException {
        updateService.set(userScore);
    }
}
